Skip to content

[haxcms-php] Generate CycloneDX SBOM from composer.lock and attach to releases - #665

Merged
btopro merged 1 commit into
masterfrom
ci/sbom-3092
Oct 20, 2026
Merged

btopro merged 1 commit into
masterfrom
ci/sbom-3092

Conversation

@btopro

@btopro btopro commented Oct 20, 2026

Copy link
Copy Markdown
Member

What changed

New workflow .github/workflows/sbom.yml:

  • Triggers: pull_request (only when composer.json/lock or the workflow changes), workflow_dispatch, release published.
  • Installs cyclonedx/cyclonedx-php-composer 6.2.0 globally (latest release per its GitHub releases) so the project's composer files are not modified; allow-plugins is set only for that package, globally.
  • Runs composer CycloneDX:make-sbom --output-format=JSON --spec-version=1.6 --omit=dev --validate against system/backend/php/composer.json and uploads sbom.cdx.json as artifact sbom-cyclonedx.
  • On release: published, a second job (the only one with contents: write) uploads sbom.cdx.json to the release. Top-level permissions are contents: read.

Decisions / caveats

  • Production dependencies only (--omit=dev); drop that flag to include phpunit etc.
  • The plugin docs say installed setups are preferred over lock-only analysis but a working lock is accepted. Only the lock is available in CI here (vendor is committed in git, but may not match the lock). Component completeness is unverified.
  • Action pinning: actions/upload-artifact@v7 and actions/download-artifact@v8 use major tags, not full SHAs, because I could not verify commit SHAs via WebFetch. Checkout and setup-php reuse the SHAs already pinned in the repo. Please pin upload/download-artifact before merge if desired.
  • Releases created by another workflow using GITHUB_TOKEN (e.g. the release workflow in the sibling PR) do not trigger release: published; releases created in the UI do. SBOM is not covered by the SHA256SUMS in the sibling PR.
  • Unsigned: no signing of the SBOM.

Files touched

  • .github/workflows/sbom.yml (new)

Testing

  • Tested: actionlint 1.7.12 passes; YAML parses.
  • NOT tested: the SBOM command was not run (packagist blocked in my sandbox), so the plugin invocation, --validate, and the output shape are unverified. The workflow has not run on GitHub Actions.

Refs haxtheweb/issues#3092


Generated by Claude Code

New sbom workflow installs cyclonedx-php-composer 6.2.0 globally, builds a
CycloneDX 1.6 JSON SBOM (production deps) for system/backend/php, uploads it
as a workflow artifact, and on release publication uploads sbom.cdx.json to
the release via a separate job holding contents: write.

Refs haxtheweb/issues#3092

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WypLHk36AAKFEbX9stGBhq
Copilot AI balanced review requested due to automatic review settings October 20, 2026 02:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@btopro
btopro merged commit efd5a86 into master Oct 20, 2026
4 checks passed
@btopro
btopro deleted the ci/sbom-3092 branch October 20, 2026 15:13
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants